﻿using System.Runtime.Serialization;

namespace Common
{
    public enum ErrorTypes
    {
        NoError,
        InvalidRequest,
        InvalidParamater,
        InternalError,
        ObjectNotFound,
        ObjectExists,
        OperationTimedOut
    }

    [DataContract]
    public class Error
    {
        [DataMember]
        public string Details;
        [DataMember]
        public string TargetSite;
        [DataMember]
        public ErrorTypes Type;

        public Error()
        {
            Details = "No error occured";
            TargetSite = this.GetType().Name;
            Type = ErrorTypes.NoError;
        }
    }
}